package sale.wxb.loveshopping.entity.common;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import springfox.documentation.annotations.ApiIgnore;

import java.time.LocalDateTime;

@Getter
@Setter
@JsonIgnoreProperties(value = { "password" })
public class BaseEntity {
    @ApiModelProperty("主键ID 雪花算法 字符串")
    private Long id;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "创建者 - 没有创建人时为system")
    @TableField(fill = FieldFill.INSERT)
    private String createUser;

    @ApiModelProperty(value = "更新时间", hidden = true)
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "更新者 - 没有更新人时为system")
    @TableField(fill = FieldFill.UPDATE)
    private String updateUser;

    @JsonIgnore
    @ApiModelProperty("是否删除")
    private Integer isDelete;

    @JsonIgnore
    @ApiModelProperty("乐观锁")
    @Version
    private Integer version;
}
